<template>
  <div class="header-container">
    <div @click="handleclick" class="l-container">
      <el-button v-if="iScon" icon="el-icon-s-unfold" size="small" style="font-size: 18px"></el-button>
      <el-button v-else icon="el-icon-s-fold" size="small" style="font-size: 18px"></el-button>
      <span>首页</span>
    </div>
    <div class="=r-container">
      <el-dropdown @command="handleCommand">
        <span class="el-dropdown-link">
          <img src="@/assets/3.jpg" class="imguser">
        </span>
        <el-dropdown-menu slot="dropdown" style="width: 100px; text-align: center;">
          <el-dropdown-item command="0">个人中心</el-dropdown-item>
          <el-dropdown-item command="1">前端</el-dropdown-item>
          <el-dropdown-item command="clickOut">退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import {  mapMutations } from 'vuex'
export default {
  data(){
    return{
      iScon:true
    }
  },
  methods:{
    ...mapMutations('tab',['changmenuisc']),
    handleclick(){
      this.iScon=!this.iScon
      this.changmenuisc(this.iScon)
    },
    handleCommand(command){
      if(command == 1)
        this.$router.push("/layout/fronthome")
      else{
        console.log("&&&&&&&&&&&&&&&&&&&&&&&")
      }
    }
  }
}
</script>

<style lang="less" scoped>
.header-container{
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid;
}
.l-container{
  padding-left: 20px;
  span{
    margin-left: 10px;
    font-size: 18px;
  }
}
.imguser{
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.el-dropdown-link{
  margin-right: 60px;
}

</style>